<template>
  <div class="all">
    <div class="save">保存</div>
    <div class="photo">
      <van-uploader :after-read="afterRead" />
      <img :src="item" v-for="item in photoList" :key="item.id" />
    </div>
  </div>
</template>

<script setup>

import { ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { getNotHeader, post, get, addToCart, poster } from '../../utils/request.js'
import Optios from './Options.vue'
import { useStore } from 'vuex'
const route = useRoute()
const router = useRouter()
const store = useStore()



let photoList = ref([])
const afterRead = async (file) => {
  let data = {
    file
  }
  let res = await poster('/update', data)
  console.log(res);
  localStorage.setItem("res", JSON.stringify(res))
  router.push("/Miner")
};






</script>

<style lang="scss" scoped>
.all {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;

  .save {
    width: 100%;

    position: absolute;
    top: 0;
    left: 0;
    text-align: right;
    margin-top: 0.1rem;

    font-size: 0.18rem;
  }
}

.photo {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 0.2rem;
  background-color: pink;

  img {
    position: absolute;
    width: 1.1rem;
    height: 1.1rem;
  }
}
</style>